{include file="public/header" /}

<body>
    <div class="container" id="container">
        <div class="page input js_show">
            <div class="page__bd">
                <article class="weui_article">
                    <h1 style="text-align: center">{$list['title']}</h1>
                    <section style="text-align: center">
                        {$list['content']}
                    </section>
                </article>

                <div class="weui-cells__title">已抢{$list['reward_count']}/{$list['person']}份，共{$list['reward_total']}/{$list['all_money_num']}元</div>
                <div class="weui-cells">
                    {volist name="list.reward" id="vo"}
                    <div class="weui-cell">
                        <div class="weui-cell__bd">
                            <img src="{$vo.user.wxuser.headimgurl}" alt="" width="50" height="50">
                        </div>
                        <div class="weui-cell__bd">
                            <p>{$vo.user.nickname}</p>
                        </div>
                        <div class="weui-cell__ft">{$vo.money}元</div>
                    </div>
                    {/volist}
                </div>
                <div class="weui-btn-area">
                    {if $list.is_reward==1}
                    <a class="weui-btn weui-btn_primary" id="submit">领红包</a> {elseif $list.is_reward==-1}
                    <a class="weui-btn weui-btn_primary" id="submit">您已经领过了</a> {else /}
                    <a class="weui-btn weui-btn_primary">已领完</a> {/if}
                </div>
            </div>

        </div>

    </div>

    
     {include file="public/footer" /}
    
     
        <script>
        $('#submit').on('click', function () {
            var params = {
                url: "{:url('getReward')}",
                data: {"id":{$list['id']}},
                type: 'post',
                sCallback: function (res) {
                    //window.location.href = "{:url('index')}";
                    dialog.success(res.msg,location.reload);

                }
            }
            common.request(params);
            return false;
        });
        </script>
    </script>
</body>

</html>